load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "catprivilege",
    srcs = [
        "default_privilege.go",
        "fix.go",
        "system.go",
        "validate.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/catprivilege",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/security/username",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/privilege",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/syntheticprivilege",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "catprivilege_test",
    srcs = [
        "default_privilege_test.go",
        "fix_test.go",
    ],
    embed = [":catprivilege"],
    deps = [
        "//pkg/keys",
        "//pkg/security/username",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/privilege",
        "//pkg/util/leaktest",
        "@com_github_stretchr_testify//require",
    ],
)
